package com.misboot.document.service.impl;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.misboot.document.mapper.OaSignaturesCaMapper;
import com.misboot.document.model.OaSignaturesCa;
import com.misboot.document.service.OaSignaturesCaService;
import com.misboot.document.utils.PageUtil.PageParam;
import com.misboot.document.utils.PageUtil.PageSet;

import com.misboot.document.utils.PageUtil.PageUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("oaSignaturesCaServiceImpl")
public class OaSignaturesCaServiceImpl extends DocumentBaseServiceImpl<OaSignaturesCa, String> implements OaSignaturesCaService {

    @Autowired
    private OaSignaturesCaMapper oaSignaturesCaMapper;

    //分页
    @Override
    public PageSet<OaSignaturesCa> getPageSet(PageParam pageParam, String filterSort) {
        PageHelper.startPage(pageParam.getPageNo(), pageParam.getPageSize());
        List<OaSignaturesCa> list = oaSignaturesCaMapper.getPageSet(filterSort);
        PageInfo<OaSignaturesCa> pageInfo = new PageInfo<>(list);
        return PageUtils.getPageSet(pageInfo);
    }

    //批量删除
    @Override
    public int executeDeleteBatch(String[] uuid) {
        return oaSignaturesCaMapper.executeDeleteBatch(uuid);
    }

    @Override
    public OaSignaturesCa getByUserNameId(String userNameId) {
        return oaSignaturesCaMapper.getByUserNameId(userNameId);
    }

    @Override
    public List<OaSignaturesCa> getCaListByTypeAndUserNameId(String type, String userNameId) {
        return oaSignaturesCaMapper.getCaListByTypeAndUserNameId(type, userNameId);
    }

}
